package com.onland.dfish.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.onland.dfish.entity.Reply;
import com.onland.dfish.mapper.ReplyMapper;
import com.onland.dfish.service.IReplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("replyService")
public class ReplyServiceImpl implements IReplyService {
    @Autowired
    private ReplyMapper replyMapper;
    @Override
    public int insert(Reply reply) {
        return replyMapper.insert(reply);
    }

    @Override
    public List<Reply> queryRely(int commentsId) {
        QueryWrapper<Reply> wrapper=new QueryWrapper<>();
        wrapper.eq("comment_id",commentsId);
        return replyMapper.selectList(wrapper);
    }
}
